#!/bin/bash

folders=(
    "0.leetcode"
    "13.minapp"
    "6.zustand"
    "0.various-projects"
    "14.aigpt"
    "7.ahooks"
    "1.webpack"
    "2.vite"
    "8.pwa"
    "10.ajv"
    "3.javascript"
    "9.test"
    "11.formily"
    "4.react"
    "12.cocos"
    "5.redux"
)

# # 遍历 learn 目录下的所有子文件夹
# for folder in "${folders[@]}"; do
#     git clone "https://gitee.com/wmaoshu/${folder}.git"
# done


# 遍历 learn 目录下的所有子文件夹
for dir in ./*; do
    if [ -d "$dir" ]; then
        # 获取文件夹名
        folder_name=$(basename "$dir")
        echo "正在检查文件夹: $folder_name"

        echo "开始处理文件夹: $folder_name"

        # 进入文件夹
        cd "$dir" || continue

        # 执行 Git 命令
        git pull origin master

        # 返回上一级目录
        cd ..
    fi
done